scripty2

class S2.UI.Accordion

Description

Applies "accordion menu" behavior to an element and its contents.

Options
  • multiple (Boolean): Whether multiple panels can be open at once. Defaults to false.
  • headerSelector (String): A CSS selector that identifies the child elements to use as accordion headers. Defaults to "h3".
  • icons (Object): The icons to use for each of the header states. Expects two properties — header and headerSelected — and a String for each. Defaults to { header: 'ui-icon-triangle-1-e', headerSelected: 'ui-icon-triangle-1-s' }.
  • transition (Function): A function that handles the transition effect when a panel is selected. Takes two arguments, panel and previousPanel, which reference the panel to be shown and the panel to be hidden, respectively. (When there is no panel to be hidden, the previousPanel argument will be null.) Defaults to a function that applies a "slide down"/"slide up" effect.

Superclass

Methods

Constructor

new S2.UI.Accordion(element[, options])
  • element (Element) – A container element.
  • options (Object) – A set of options for customizing the widget.

Creates an S2.UI.Accordion.